3.3.70 \(\int \frac {a+\frac {b}{x^2}}{c+\frac {d}{x^2}} \, dx\) [270]

Optimal. Leaf size=39 \[ \frac {a x}{c}+\frac {(b c-a d) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {d}}\right )}{c^{3/2} \sqrt {d}} \]

[Out]

a*x/c+(-a*d+b*c)*arctan(x*c^(1/2)/d^(1/2))/c^(3/2)/d^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {381, 396, 211} \begin {gather*} \frac {(b c-a d) \text {ArcTan}\left (\frac {\sqrt {c} x}{\sqrt {d}}\right )}{c^{3/2} \sqrt {d}}+\frac {a x}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b/x^2)/(c + d/x^2),x]

[Out]

(a*x)/c + ((b*c - a*d)*ArcTan[(Sqrt[c]*x)/Sqrt[d]])/(c^(3/2)*Sqrt[d])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 381

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(n*(p + q))*(b + a/x^n)^
p*(d + c/x^n)^q, x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] && NegQ[n]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {a+\frac {b}{x^2}}{c+\frac {d}{x^2}} \, dx &=\int \frac {b+a x^2}{d+c x^2} \, dx\\ &=\frac {a x}{c}-\frac {(-b c+a d) \int \frac {1}{d+c x^2} \, dx}{c}\\ &=\frac {a x}{c}+\frac {(b c-a d) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {d}}\right )}{c^{3/2} \sqrt {d}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 40, normalized size = 1.03 \begin {gather*} \frac {a x}{c}-\frac {(-b c+a d) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {d}}\right )}{c^{3/2} \sqrt {d}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b/x^2)/(c + d/x^2),x]

[Out]

(a*x)/c - ((-(b*c) + a*d)*ArcTan[(Sqrt[c]*x)/Sqrt[d]])/(c^(3/2)*Sqrt[d])

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 34, normalized size = 0.87

method result size
default \(\frac {a x}{c}+\frac {\left (-a d +b c \right ) \arctan \left (\frac {c x}{\sqrt {c d}}\right )}{c \sqrt {c d}}\) \(34\)
risch \(\frac {a x}{c}-\frac {\ln \left (c x -\sqrt {-c d}\right ) a d}{2 c \sqrt {-c d}}+\frac {\ln \left (c x -\sqrt {-c d}\right ) b}{2 \sqrt {-c d}}+\frac {\ln \left (-c x -\sqrt {-c d}\right ) a d}{2 c \sqrt {-c d}}-\frac {\ln \left (-c x -\sqrt {-c d}\right ) b}{2 \sqrt {-c d}}\) \(106\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b/x^2+a)/(c+d/x^2),x,method=_RETURNVERBOSE)

[Out]

a*x/c+(-a*d+b*c)/c/(c*d)^(1/2)*arctan(c*x/(c*d)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 33, normalized size = 0.85 \begin {gather*} \frac {a x}{c} + \frac {{\left (b c - a d\right )} \arctan \left (\frac {c x}{\sqrt {c d}}\right )}{\sqrt {c d} c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x^2)/(c+d/x^2),x, algorithm="maxima")

[Out]

a*x/c + (b*c - a*d)*arctan(c*x/sqrt(c*d))/(sqrt(c*d)*c)

________________________________________________________________________________________

Fricas [A]
time = 2.14, size = 98, normalized size = 2.51 \begin {gather*} \left [\frac {2 \, a c d x + {\left (b c - a d\right )} \sqrt {-c d} \log \left (\frac {c x^{2} + 2 \, \sqrt {-c d} x - d}{c x^{2} + d}\right )}{2 \, c^{2} d}, \frac {a c d x + {\left (b c - a d\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{d}\right )}{c^{2} d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x^2)/(c+d/x^2),x, algorithm="fricas")

[Out]

[1/2*(2*a*c*d*x + (b*c - a*d)*sqrt(-c*d)*log((c*x^2 + 2*sqrt(-c*d)*x - d)/(c*x^2 + d)))/(c^2*d), (a*c*d*x + (b
*c - a*d)*sqrt(c*d)*arctan(sqrt(c*d)*x/d))/(c^2*d)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (34) = 68\).
time = 0.30, size = 82, normalized size = 2.10 \begin {gather*} \frac {a x}{c} + \frac {\sqrt {- \frac {1}{c^{3} d}} \left (a d - b c\right ) \log {\left (- c d \sqrt {- \frac {1}{c^{3} d}} + x \right )}}{2} - \frac {\sqrt {- \frac {1}{c^{3} d}} \left (a d - b c\right ) \log {\left (c d \sqrt {- \frac {1}{c^{3} d}} + x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x**2)/(c+d/x**2),x)

[Out]

a*x/c + sqrt(-1/(c**3*d))*(a*d - b*c)*log(-c*d*sqrt(-1/(c**3*d)) + x)/2 - sqrt(-1/(c**3*d))*(a*d - b*c)*log(c*
d*sqrt(-1/(c**3*d)) + x)/2

________________________________________________________________________________________

Giac [A]
time = 0.57, size = 33, normalized size = 0.85 \begin {gather*} \frac {a x}{c} + \frac {{\left (b c - a d\right )} \arctan \left (\frac {c x}{\sqrt {c d}}\right )}{\sqrt {c d} c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x^2)/(c+d/x^2),x, algorithm="giac")

[Out]

a*x/c + (b*c - a*d)*arctan(c*x/sqrt(c*d))/(sqrt(c*d)*c)

________________________________________________________________________________________

Mupad [B]
time = 0.07, size = 32, normalized size = 0.82 \begin {gather*} \frac {a\,x}{c}-\frac {\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {d}}\right )\,\left (a\,d-b\,c\right )}{c^{3/2}\,\sqrt {d}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/x^2)/(c + d/x^2),x)

[Out]

(a*x)/c - (atan((c^(1/2)*x)/d^(1/2))*(a*d - b*c))/(c^(3/2)*d^(1/2))

________________________________________________________________________________________